package com.wjd.wshow.repository;

import com.wjd.wshow.entity.Image;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository("ImageRepository")
public interface ImageRepository extends ResourceRepository<Image, String> {

    @Query("SELECT v FROM #{#entityName} v WHERE v.path LIKE :path% ORDER BY v.name")
    List<Image> findByPath(@Param("path") String path);

}
